<div class="b-island__title">{{'attachment.ATTACHMENT' | translate}}</div>
<div ng-controller="AttachmentPreviewCtrl" class="attachment">
    <div class="pane__header">
        <h3>
            <div class="pane__header_controls pull-right">
                <span class="fa fa-expand clickable" tooltip="{{'tooltip.EXPAND' | translate}}" ng-hide="isState('testcase.attachment.expanded')" ng-click="go('testcase.attachment.expanded')"></span>
                <span class="fa fa-compress clickable" tooltip="{{'tooltip.COLLAPSE' | translate}}" ng-show="isState('testcase.attachment.expanded')" ng-click="go('testcase.attachment')"></span>
                <span class="fa fa-close clickable" tooltip="{{'tooltip.CLOSE' | translate}}" ng-click="go('testcase')"></span>
            </div>
            {{attachment.title}}
        </h3>
        <a class="text-muted" ng-href="{{getSourceUrl(attachment)}}">{{attachment.source}}</a>
    </div>
    <div class="attachment_body" ng-switch="type" ng-hide="notFound">
        <div ng-switch-when="image" class="text-center">
            <img ng-src="{{getSourceUrl(attachment)}}" alt="{{'tooltip.ATTACHMENT_IMAGE' | translate}}" ng-class="{'zoom-in': !isExpanded(), 'zoom-out': isExpanded()}" ng-click="toggleExpanded()" on-error="onError()" />
        </div>
        <div ng-switch-when="text">
            <pre><code>{{attachText}}</code></pre>
        </div>
        <div ng-switch-when="csv">
            <table class="test-list table table-striped table-condensed">
                <tbody>
                <tr ng-repeat="row in rows">
                    <td ng-repeat="cell in row">{{cell}}</td>
                </tr>
                </tbody>
            </table>
        </div>
        <div ng-switch-when="code">
            <pre><code data-language="{{language}}" highlight="attachText"></code></pre>
        </div>
        <div ng-switch-when="svg" class="text-center">
            <object type="image/svg+xml" data="{{getSourceUrl(attachment)}}">Your browser does not support SVG</object>
        </div>
        <div ng-switch-default>
            <iframe style="width: 100%; min-height: 600px;" frameborder="0" ng-src="{{getSourceUrl(attachment)}}" on-error="onError()"></iframe>
        </div>
    </div>
    <p ng-show="notFound"><i class="text-muted">{{'attachment.NOT_FOUND' | translate}}</i></p>
</div>
